
/**
 * promise 形式的openSetting
 * 打开授权界面
 */
export const getSetting = () => {
   return new Promise((resolve,reject) => {
  wx.getSetting({
  success: (result) => {
    resolve(result);
  },
  fail: (err) => {
    reject(err);
  },
});
  
       
   });
};
// 获取授权信息
export const OpenSetting = () => {
  return new Promise((resolve,reject) => {
    wx.openSetting({
      success: (result) => {
       resolve(result);
      },
      fail: (err) => {
       reject(err);
      },
    });
      
  });
};
//  获取收货地址信息
export const chooseAddress = () => {
  return new Promise((resolve,reject) => {
  wx.chooseAddress({
    success: (result) => {
      resolve(result);
    },
    fail: (err) => {
      reject(err);
    },
  });
    
      
  });
};

// 消息弹框
export const showModal = ({content}) => {
  return new Promise((resolve,reject) => {
  wx.showModal({
      title: '提示',
      content: content,
    success: (res) => {
      resolve(res);
    },
  })
});
};
// 提示信息
export const showToast = ({title}) => {
  return new Promise((resolve,reject) => {
  wx.showModal({
      title: title,
      icon: 'none',
    success: (res) => {
      resolve(res);
    },
  })
});
};

export const login = () => {
  return new Promise((resolve,reject) => {
wx.login({
  timeout:10000,
  success: (result) => {
    resolve(result)
  },
  fail: (err) => {
    reject(err);
  },
});
  
});
};
  